#ifndef UMLHIGHLIGHTER_H
#define UMLHIGHLIGHTER_H

#include <QSyntaxHighlighter>
#include <QDebug>

class UmlHighlighter : public QSyntaxHighlighter
{ 
public:
    enum Type {
        Visibility,
        PrimitiveDatatype,
        CustomDatatype,
        MethodName,
        Stereotype,
        Property
    };

    UmlHighlighter(QTextDocument *document = 0);

    void highlightBlock(const QString &text);

protected:
    QMultiHash<Type, QRegExp> _regexForType;

    void addRegex(Type type, const QString &pattern, bool minimal);

    virtual void applyFormat(Type type, int index, int length) = 0;

};

#endif // UMLHIGHLIGHTER_H
